#ifndef MAIN_H
#define MAIN_H

/*
types
typedef unsigned char u8;
typedef unsigned long u32;

typedef unsigned int size_t;
#define NULL 0

*/
typedef unsigned char bool;
#define true 1
#define false 0

#include <pspkernel.h>
#include <pspctrl.h>
#include <psppower.h>
/* Define printf, just to make typing easier */
/*
#include <pspdebug.h>
#define printf	pspDebugScreenPrintf
*/

//zlib support
#include <zlibType.h>
#include <zlibFileMemory.h>
#include <zlib.h>
#include <unzip.h>

#include <string.h>

#include "filer.h"
#include "pg.h"
#include "chinesedraw.h"
#include "book.h"
//#include "wireless.h"

#define SCREEN_WIDTH  480
#define SCREEN_HEIGHT 272

#define PSPVER " PSP CN.READER Fix4"

#define BG_COLOR rgb2col(bookconf.bgcolorR,bookconf.bgcolorG,bookconf.bgcolorB)
#define FONT_COLOR rgb2col(bookconf.fontcolorR,bookconf.fontcolorG,bookconf.fontcolorB)

/*typedef struct
{
	int vsync;
	int screensize;
} SETTING;
*/
extern const unsigned char UNI_CJK[];
//extern const unsigned short JIS_UNICODE[];
extern unsigned char PbpPath[],readfilename[],BookMarkPath[],gTextBuf[],DirPath[];

extern unsigned char* hazfont;

/* Our own notion of wide character, as UCS-4, according to ISO-10646-1. */
typedef unsigned int ucs4_t;
/* Return code if invalid. (xxx_mbtowc) */
#define RET_ILSEQ      -1
/* Return code if only a shift sequence of n bytes was read. (xxx_mbtowc) */
#define RET_TOOFEW(n)  (-2-(n))

#define selitem rgb2col(0xff,0x66,0x00)
#define uniitem rgb2col(0xff,0x33,0x33)
#define subtitlecol rgb2col(0xff,0xff,0x99)

extern bool isUnicode;
extern bool isChangeEncode;
extern int isautob;
//extern SETTING setting;


#endif

